package net.jumpengine.event;

import javafx.scene.input.KeyCode;
import net.jumpengine.Manager;
import net.jumpengine.bean.Base;
import net.jumpengine.inter.IHandle;
import net.jumpengine.inter.IInputEvent;

public class InputEvent implements IInputEvent {
	private int num=0;

	@Override
	public void pressed(String character, KeyCode code, String text) {
		Manager.getLog().info("InputEvent[pressed]","<->",character," ",code," ",text);
	}

	@Override
	public void released(String character, KeyCode code, String text) {
		if(code==KeyCode.ESCAPE) {
			Manager.confirm("第"+num+"次询问!", new IHandle() {
				@Override
				public void handle(Base base,String result) {
					System.out.println("点击确认!");					
				}
			});
		}

	}

	@Override
	public void typed(String character, KeyCode code, String text) {
		// TODO Auto-generated method stub

	}

}
